package com.example.secondhandsysapi.Service;


import com.example.secondhandsysapi.Entity.BrowseLogInfo;
import com.example.secondhandsysapi.Mapper.BrowseLogInfoMapper;
import com.example.secondhandsysapi.Vo.BrowseGoodsInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class BrowseLogInfoServiceImpl implements BrowseLogInfoService{

    @Autowired
    private BrowseLogInfoMapper browseLogInfoMapper;

    @Override
    public List<BrowseGoodsInfo> getBrowseLogInfo(Integer user_id) {
        return browseLogInfoMapper.getBrowseLogInfo(user_id);
    }

    @Override
    public List<BrowseGoodsInfo> getBrowseInfoByIdAndName(Integer user_id,String name) {
        return browseLogInfoMapper.getBrowseInfoByIdAndName(user_id,name);
    }

    @Override
    public List<BrowseGoodsInfo> getBrowseInfoByIdAndDate(Integer user_id, Date date) {
        return browseLogInfoMapper.getBrowseInfoByIdAndDate(user_id,date);
    }

    @Override
    public List<BrowseGoodsInfo> getBrowseInfoByIdAndDateAndName(Integer user_id, Date date, String name) {
        return browseLogInfoMapper.getBrowseInfoByIdAndDateAndName(user_id,date,name);
    }


    @Override
    public Integer getActiveUserCount(Date browse_time) {
        Integer i = browseLogInfoMapper.getActiveUserCount(browse_time);
        return i;
    }

    @Override
    public Integer insertBrowseLogInfo(Integer user_id, Integer goods_id) {
        Integer i = browseLogInfoMapper.insertBrowseLogInfo(user_id, goods_id);
        return 1;
    }
}
